package com.nirvana.admin.controller;

import com.nirvana.admin.service.CaptchaService;
import com.nirvana.common.constant.BaseMessage;
import com.nirvana.common.dto.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author zhangshuaiyin
 * @date 2021-09-29 10:30
 */
@Api(tags = "验证码")
@RestController
@RequestMapping("/system/captcha")
public class CaptchaController {
    @Resource
    private CaptchaService captchaService;

    @GetMapping
    @ApiOperation("生成图片验证码")
    public BaseResponse<?> getCaptchaImage() {
        return BaseMessage.SUCCESS.response(captchaService.getCaptchaImage());
    }
}
